home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14023 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Static vs Dynamic linking
  5. Date: Wed, 10 Apr 96 20:27:21 GMT
  6. Organization: none
  7. Message-ID: <829168041snz@genesis.demon.co.uk>
  8. References: <4kefrj$smn@nntp.ucs.ubc.ca> <316ADDB7.731@willows.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <316ADDB7.731@willows.com>
  15.            tarang@willows.com "Tarang Deshpande" writes:
  16.  
  17. >Daniel l Aldham wrote:
  18. >> 
  19. >> Could someone explain , or  point out a good reference to , what
  20. >> is the difference and/or advantages of static versus dynamic linking.
  21. >> Thanks
  22. >> 
  23. >> Danny Aldham
  24. >
  25. >
  26. >Static linking occures at compile time whereas dynamic linking occurs
  27. >at run-time.  Because of this a program that uses dynamic linking will
  28. >run slighly slower than the same program linked staticly because the
  29. >linker is figuring out what address to jump to when a call is made
  30. >as opposed to having figured that out when compiling as in static
  31. >linking.
  32.  
  33. A dynamic linker links the executable at the point where it is run (or
  34. possibly the program may explicitly link other libraries while
  35. executing), it is not active during normal program execution.
  36.  
  37. > The advantage of dynamic linking is it allows more than
  38. >one program at a time to share the DLL whereas if the programs were
  39. >staticly linked then each program would have its own copy.
  40.  
  41. Static shared libraries have been doing this for years.
  42.  
  43. > Another
  44. >advantage of dynamic linking is it allows you to change something 
  45. >in the DLL without having to recompile the program(s) as long as
  46. >there is no interface change.
  47.  
  48. Again static shared libraries do this.
  49.  
  50. > As an offshoot to this if you need
  51. >to distribute your software then updating users with one DLL is easier
  52. >than updating users with multiple programs.
  53.  
  54. You may be thinking of DLL in Windows specific terms. Of course static
  55. and dynamic linked libraries exist on a wide variety of platforms.
  56.  
  57. -- 
  58. -----------------------------------------
  59. Lawrence Kirby | fred@genesis.demon.co.uk
  60. Wilts, England | 70734.126@compuserve.com
  61. -----------------------------------------
  62.